﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XMLSpreadGear.Core;

namespace XMLSpreadGear.Templates
{
    public class GenericElement:BaseElement
    {
        private IDictionary<string, string> dicattribute;
        private IDictionary<string, string> dicelements;

        public IDictionary<string, string> Elements
        {
            get { return ((dicelements== null)?new Dictionary<string,string>():dicelements); }
            set { dicelements = value; }
        } 

        public IDictionary<string, string> Attributes
        {
            get { return ((dicattribute == null)? new Dictionary<string,string>():dicattribute); }
            set { dicattribute = value; }
        }

        public GenericElement(string strLocalName)
            : base(strLocalName)
        {
        }

        public GenericElement(string strLocalName, IDictionary<string,string> attributeCollection, IDictionary<string,string> elementCollection)
            : this(strLocalName)
        {
            this.dicattribute = attributeCollection;
            this.dicelements = elementCollection;
        }

        internal protected override IDictionary<string, string> RegisterElements()
        {
            return this.Elements;
        }

        internal protected override IDictionary<string, string> RegisterAttributes()
        {
            return this.Attributes;
        }

        protected override void SetDefaults()
        {
            return;
        }
    }
}
